﻿package little.bunny.adapter;

import java.util.ArrayList;

import little.bunny.R;
import little.bunny.bean.SortS;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class Nei_List_Adapter extends BaseAdapter {
	private ArrayList<SortS> getSortS_List;
	private LayoutInflater myInflater;
	public Nei_List_Adapter(Context context, ArrayList<SortS> getSortS_List) {
		super();
		this.getSortS_List = getSortS_List;
		myInflater=LayoutInflater.from(context);
	}

	public int getCount() {
		// TODO Auto-generated method stub
		return getSortS_List.size();
	}

	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return getSortS_List.get(position);
	}

	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder = null;
		if (convertView == null) {
			// 自定义list_items为layout
			convertView = myInflater.inflate(R.layout.list_lists_items, null);
			/* 初始化holder */
			holder = new ViewHolder();
			holder.sort_title = (TextView) convertView.findViewById(R.id.shops_title);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		// File f = new File(paths.get(position).toString());
		holder.sort_title.setText(getSortS_List.get(position).getSortName().toString());
		return convertView;
	}
	/**
	 * 不单独写get set可以提高效率 class ViewHolder
	 * */
	private class ViewHolder {
		TextView sort_title;
		
		
	}
}
